<script type="text/javascript">
$(function () {
	$.ajaxSetup({cache:false});
});
function showPageDiv(btn,page){
	$(".showDiv").each(function(){
		$(this).hide();
	})
	$("#tags").find("li").each(function(){
		$(this).removeClass("active");
	})
	btn.parent().addClass("active");
	$("#tagContent"+page).show();
}

</script>
<#import "/freemarker/modeltype_entity.ftl" as mte>
<div style="text-align: center;">
	<button class="btn btn-primary" title="取消" onclick="javascript: $.fn.colorbox.close(); return false;">关闭</button>
</div>
<#if a?? && a == 1>
<h4>${(er.ccn)!''}</h4>
<div style="width: 100%;">
	<div style="width: 40%;float: left;">
		<ul id="tags" class="nav nav-tabs tabs-vertical">
			<#assign page = (list?size / 10) />
			<#if (list?size % 10 > 0)><#assign page = page + 1 /></#if>
			<#list 1..page as pa>
				<li<#if (pa == 1)> class="active"</#if>><a href="javascript:;" onclick="showPageDiv($(this),'${pa}'); return false;">第 ${pa} 页</a></li>
			</#list>
		</ul>
	</div>
	<div style="float: right;">
		<span>总分:&nbsp;<span style="font-size: 20px;color: red;">${(er.examScore)!''}</span></span>
		<button class="btn btn-primary" title="取消" onclick="javascript: $.fn.colorbox.close(); return false;">关闭</button>
	</div>
</div>
<!-- 题目 -->
<div style="clear: both;">
	<form id="editShowExamRecordForm">
		<div id="tagContent" class="tab-content " style="margin-top:0px;">
			<#list 1..page as pa>
			<div class="tab-pane showDiv" id="tagContent${pa}" style="margin-top:0px; overflow-y:scroll; height:590px;<#if (pa == 1)>display: block;<#else>display: none;</#if>">
				<#list list as p>
				<#if ((p_index >= ((pa - 1) * 10)) && (p_index < (pa * 10)))>
				<h5 style="border-bottom:1px #ddd dashed; margin-top: 0px;">第${p_index + 1}题 (<@mte.Problemtype s=false value=(p.type) />${p.points}分) &nbsp;&nbsp;${p.content}</h5>
				<#if (p.type == 1)>
					<table>
					<#list p.tkList as pa>
						<tr>
							<td style="width: 25px;height: 20px;color: #1e90ff;">
							<#list p.arList as ar>
								<#if pa.code == ar.answerCode>
								<i class="icon-ok-sign"></i>
								</#if>
							</#list>
							</td>
							<td>${pa.answer}</td>
						</tr>
					</#list>
					</table>
				<#elseif (p.type == 2)>
					<table>
					<#list p.tkList as pa>
						<tr>
							<td style="width: 25px;height: 20px;color: #1e90ff;">
							<#list p.arList as ar>
								<#if pa.code == ar.answerCode>
								<i class="icon-ok-sign"></i>
								</#if>
							</#list>
							</td>
							<td>${pa.answer}</td>
						</tr>
					</#list>
					</table>
				<#elseif (p.type == 3)>
				<span style="float: right;margin-right: 20px;">得分:&nbsp;<span style="color: red;">${p.point}</span></span>
				<div style="overflow: auto;">
					<#list p.arList as ar>
						<#if p.code == ar.tc>
							${ar.content}
						</#if>
					</#list>
				</div>
				</#if>
				</#if>
				</#list>
			</div>
			</#list>
		</div>
	</form>
</div>
<#elseif a?? && a == 2>
<div>
	<div>
		<ul id="tags" class="nav nav-tabs tabs-vertical">
			<#assign page = (trList?size / 10) />
			<#if (trList?size % 10 > 0)><#assign page = page + 1 /></#if>
			<#list 1..page as pa>
				<li<#if (pa == 1)> class="active"</#if>><a href="javascript:;" onclick="showPageDiv($(this),'${pa}'); return false;">第 ${pa} 页</a></li>
			</#list>
		</ul>
	</div>
	<div style="margin-top: 5px;">
		<span style="float: left;margin-left: 15px;"><button class="btn btn-xs btn-danger"   title="正确答案"><i class="icon-check"></i></button>&nbsp;正确答案</span>
		<span style="float: left;margin-left: 15px;"><button class="btn btn-xs btn-info"  title="选中的答案" ><i class="icon-check"></i></button>&nbsp;勾选的答案</span>
		<!-- <span style="float: left;margin: 5px 0px 0px 15px;" id="totalPoint">本次考试得分：</span> -->
	</div>
</div>
<!-- 题目 -->
<div style="clear: both;">
	<form id="editMarkForm" method="post">
		<!-- 考试记录表信息 -->
		<input type="hidden" value="${info.code!''}" name="code"/>
		<input type="hidden" value="${info.examScore!0}" name="examScore" id="examScore"/>
		<input type="hidden" value="${info.cc!''}" name="cc"/>
		<input type="hidden" value="${info.clc!''}" name="clc"/>
		<input type="hidden" value="true" name="isMark"/>
		<div id="tagContent" class="tab-content " style="margin-top:0px;">
			<#list 1..page as pa>
			<table class="table table-bordered showDiv" id="tagContent${pa}" style="<#if (pa == 1)><#else>display: none;</#if>"  >
				<#assign i = 0 />
				<#list trList as p>
				<#if ((p_index >= ((pa - 1) * 10)) && (p_index < (pa * 10)))>
				<tr>
					<th colspan="3">
						第${p_index + 1}题 (<@mte.Problemtype s=false value=(p.topic.type) />) &nbsp;&nbsp;${p.topic.content}&nbsp;&nbsp;<span >(分值  ：${p.points!0}分) (得分：${p.point!0}分)<#if p.topic.type != 3><input type="hidden" value="${p.point!0}" class="point" /></#if> </span>
					</th>
				</tr>
				<#if (p.topic.type == 1) || p.topic.type == 2>
					<#list p.topic.itemList as pa>
					<tr>
						<td style="width:20px;text-align: center;">
						<#if pa.isRight>
							<button class="btn btn-xs btn-danger" onclick="onclickNull();return false;" title="正确答案">
								<i class="icon-check"></i>
							</button>
						</#if>
						</td>
						<td style="width:20px;">
						<#list p.arList as ar >
							<#if ar.answerCode == pa.code>
								<button class="btn btn-xs btn-info"  onclick="onclickNull();return false;" title="选中的答案">
									<i class="icon-check"></i>
								</button>
							</#if>
						</#list>
						</td>
						<td style="text-align: left;">
							${pa.answer}
						</td>
					</tr>
					</#list>
				<#elseif p.topic.type == 3>
					<#list p.topic.itemList as pa>
					<tr>
						<td style="color:red;" colspan="5">
							正确答案：${pa.answer}
						 </td>
					</tr>
					<tr>
						<td style="color:blue" colspan="5">
							<input type="hidden" name="trList[${i}].code" value="${p.code}" />
						 	学生答案：<#list p.arList as ar ><#if ar.content != null >
							<textarea style="width:400px;" rows="4" disabled="disabled">${ar.content}</textarea></#if></#list>
						 </td>
					</tr>
					</#list>
				</#if>
				</#if>
				<#assign i = i + 1 />
				</#list>
			</table>
			</#list>
		</div>
	</form>
</div>
</#if>
